/**
 * 
 */
package example.common.ds;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author shipeng
 *
 */
public class GlobalDataSource extends AbstractRoutingDataSource {

  /*
   * (non-Javadoc)
   * 
   * @see
   * org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource#determineCurrentLookupKey(
   * )
   */
  @Override
  protected Object determineCurrentLookupKey() {
    return DataSourceHolder.getCurrentDS().getCode();
  }

}
